package com.vipheyue.bigbusiness.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lidroid.xutils.util.LogUtils;
import com.vipheyue.bigbusiness.R;
import com.vipheyue.bigbusiness.bean.EmployeeBean;
import com.vipheyue.bigbusiness.utils.GsonUtils;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class EmployeeDetailActivity extends Activity {

    @Bind(R.id.rl_menu_left)
    RelativeLayout rl_menu_left;
    @Bind(R.id.tv_Menu_Title)
    TextView tv_Menu_Title;
    @Bind(R.id.iv_menu_right)
    ImageView iv_menu_right;
    @Bind(R.id.rl_menu_right)
    RelativeLayout rl_menu_right;
    @Bind(R.id.tv_company_name)
    TextView tv_company_name;
    @Bind(R.id.tv_EmployeeNAME)
    TextView tv_EmployeeNAME;
    @Bind(R.id.tv_EmployeeID)
    TextView tv_EmployeeID;
    @Bind(R.id.tv_EmployeeMale)
    TextView tv_EmployeeMale;
    @Bind(R.id.tv_EmployeeInterviewDate)
    TextView tv_EmployeeInterviewDate;
    @Bind(R.id.tv_EmployeeCheckInDate)
    TextView tv_EmployeeCheckInDate;
    @Bind(R.id.tv_EmployeeCheckOutDate)
    TextView tv_EmployeeCheckOutDate;
    @Bind(R.id.tv_EmployeeWorkDays)
    TextView tv_EmployeeWorkDays;
    @Bind(R.id.tv_EmployeeWorkTEN)
    TextView tv_EmployeeWorkTEN;
    @Bind(R.id.tv_EmployeeSource)
    TextView tv_EmployeeSource;
    @Bind(R.id.tv_EmployeeWorking)
    TextView tv_EmployeeWorking;
    @Bind(R.id.tv_EmployeeOutWorkDate)
    TextView tv_EmployeeOutWorkDate;
    @Bind(R.id.tv_EmployeeOtherInfo)
    TextView tv_EmployeeOtherInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_employee_detail);
        ButterKnife.bind(this);
        String EmployeeStr = getIntent().getStringExtra("EmployeeStr");
        LogUtils.i(EmployeeStr);
        EmployeeBean e = GsonUtils.fromJson(EmployeeStr, EmployeeBean.class);
        tv_Menu_Title.setText("详情");

        tv_company_name.setText(e.getEmployeeCompanyName());
        tv_EmployeeNAME.setText(e.getEmployeeNAME());
        tv_EmployeeID.setText(e.getEmployeeID());
        if (e.getEmployeeMale()) {
            tv_EmployeeMale.setText("男");
        } else {
            tv_EmployeeMale.setText("女");
        }
        tv_EmployeeInterviewDate.setText(e.getEmployeeInterviewDate());
        tv_EmployeeCheckInDate.setText(e.getEmployeeCheckInDate());
        tv_EmployeeCheckOutDate.setText(e.getEmployeeCheckOutDate());
        tv_EmployeeWorkDays.setText(e.getEmployeeWorkDays());
        tv_EmployeeWorkTEN.setText(e.getEmployeeWorkTEN());
        tv_EmployeeSource.setText(e.getEmployeeSource());
        if (e.getEmployeeWorking()) {
            tv_EmployeeWorking.setText("在职");
        } else {
            tv_EmployeeWorking.setText("离职");
        }

        tv_EmployeeOutWorkDate.setText(e.getEmployeeOutWorkDate());
        tv_EmployeeOtherInfo.setText(e.getEmployeeOtherInfo());
    }

    @OnClick(R.id.rl_menu_left)
    public void onClick() {
        finish();
    }
}
